<html>
<head><meta charset="utf-8"><title>Platform triple parts explained · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Platform.20triple.20parts.20explained.html">Platform triple parts explained</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="244607839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Platform%20triple%20parts%20explained/near/244607839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> UebelAndre <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Platform.20triple.20parts.20explained.html#244607839">(Jul 01 2021 at 18:26)</a>:</h4>
<p>Is there a write up of what each section of a platform triple is? Looking at. <a href="https://doc.rust-lang.org/nightly/rustc/platform-support.html">https://doc.rust-lang.org/nightly/rustc/platform-support.html</a></p>
<p><code>arm-unknown-linux-gnueabihf</code><br>
cpu = <code>arm</code><br>
vendor = <code>unknown</code><br>
system = <code>linux</code><br>
??? = <code>gnueabihf</code></p>



<a name="244608769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Platform%20triple%20parts%20explained/near/244608769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Platform.20triple.20parts.20explained.html#244608769">(Jul 01 2021 at 18:34)</a>:</h4>
<p>From rustc's point of view the whole triple is a single unstructured string, it doesn't break it into parts in any ways.</p>



<a name="244608835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Platform%20triple%20parts%20explained/near/244608835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Platform.20triple.20parts.20explained.html#244608835">(Jul 01 2021 at 18:35)</a>:</h4>
<p>But generally the convention is <code>&lt;arch&gt;&lt;subarch&gt;-&lt;vendor&gt;-&lt;os&gt;-&lt;abi&gt;</code>.</p>



<a name="244608855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Platform%20triple%20parts%20explained/near/244608855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Platform.20triple.20parts.20explained.html#244608855">(Jul 01 2021 at 18:35)</a>:</h4>
<p><a href="https://clang.llvm.org/docs/CrossCompilation.html#target-triple">https://clang.llvm.org/docs/CrossCompilation.html#target-triple</a></p>



<a name="244614711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Platform%20triple%20parts%20explained/near/244614711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Platform.20triple.20parts.20explained.html#244614711">(Jul 01 2021 at 19:23)</a>:</h4>
<p>Also, "vendor" is somewhat vestigial, and almost no current platform uses it for anything meaningful or useful.</p>



<a name="244614739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Platform%20triple%20parts%20explained/near/244614739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Platform.20triple.20parts.20explained.html#244614739">(Jul 01 2021 at 19:24)</a>:</h4>
<p>(There are a few target triples that use it in a way that should <em>probably</em> be part of "abi" instead.)</p>



<a name="244614824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Platform%20triple%20parts%20explained/near/244614824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Platform.20triple.20parts.20explained.html#244614824">(Jul 01 2021 at 19:24)</a>:</h4>
<p>Also, for Rust's purposes, <code>gnueabihf</code> gets split into <code>gnu</code> and <code>eabihf</code>, which are treated as two different things inside rustc and when exposed to Rust <code>cfg</code> directives.</p>



<a name="244627559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Platform%20triple%20parts%20explained/near/244627559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> UebelAndre <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Platform.20triple.20parts.20explained.html#244627559">(Jul 01 2021 at 21:12)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> What does that split end up looking like? Are you saying <code>gnueabihf</code> would generate <code>--cfg=gnu</code> and <code>--cfg=eabihf</code>?</p>



<a name="244627651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Platform%20triple%20parts%20explained/near/244627651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Platform.20triple.20parts.20explained.html#244627651">(Jul 01 2021 at 21:13)</a>:</h4>
<p>No, they're provided as named <code>target_</code> constructs. One moment...</p>



<a name="244627816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Platform%20triple%20parts%20explained/near/244627816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Platform.20triple.20parts.20explained.html#244627816">(Jul 01 2021 at 21:14)</a>:</h4>
<p><a href="https://doc.rust-lang.org/reference/conditional-compilation.html">https://doc.rust-lang.org/reference/conditional-compilation.html</a></p>



<a name="244627942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Platform%20triple%20parts%20explained/near/244627942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Platform.20triple.20parts.20explained.html#244627942">(Jul 01 2021 at 21:14)</a>:</h4>
<p><code>gnueabihf</code> has <code>target_env="gnu"</code></p>



<a name="244628020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Platform%20triple%20parts%20explained/near/244628020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Platform.20triple.20parts.20explained.html#244628020">(Jul 01 2021 at 21:15)</a>:</h4>
<p>And <code>target_abi="eabihf"</code>.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>